#ifndef _UART_H_
#define _UART_H_

#include "stdio.h"
#include "esp_log.h"
#include "driver/uart.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include <unistd.h>
#include <stdint.h>
#include <stddef.h>

#include "geminai_log.h"
#include "geminai_hlw8032.h"
#include "geminai_gpio.h"

#define UART1_TX_PIN 17
#define UART1_RX_PIN 18
#define RS485_CTRL_PIN 16
#define UART1_BAUDRATE 115200

#define RX_Meter    13  //电量计

void uart1_Init(void);
void RS485_Send(uint8_t *data, uint16_t len);
void RS485_Recv(uint8_t *data, uint16_t len);

void Meter_Init(void);
void Meter_Recv_task(void* tar);
void Meter_Recv_once(void);

#endif
